package com.vd.dsl;

public class EdgeBuilder {
	Edge edge;
	GraphBuilder gBuilder;
	public EdgeBuilder(GraphBuilder gBuilder) {
		this.gBuilder=gBuilder;
		this.edge=new Edge();
	}
	public EdgeBuilder from(String lbl){
		Vertex v = new Vertex(lbl);
		edge.setFromVertex(v);
		gBuilder.getGraph().addVertice(v);
		return this;
	}
	public EdgeBuilder to(String lbl){
		Vertex v = new Vertex(lbl);
		edge.setToVertex(v);
		gBuilder.getGraph().addVertice(v);
		return this;
	}
	public GraphBuilder weigth(Double d){
		edge.setWeight(d);
		return gBuilder;
	}
}
